<template>
  <div class="video-monitor">
    <aside class="aside">
      <div class="search-wrap" @click="openDia">
        <img class="img" src="./images/search.png" alt="" />
        <span>搜索</span>
      </div>
      <el-tree
        node-key="id"
        indent="20"
        :data="data"
        :props="defaultProps"
        @node-click="handleNodeClick"
      />
    </aside>
    <main class="main">
      <header class="header">
        <TitleName name="视频监控" />

        <el-form :model="formData" size="large">
          <el-form-item label="项目名称:">
            <el-col :span="11">
              <el-input style="width: 60%" v-model="value1"></el-input>

              <el-button class="search">查询</el-button>
            </el-col>
          </el-form-item>
        </el-form>
      </header>
      <div class="content">
        <div class="video-wrap">
          <div class="video"></div>
          <div class="device-msg">
            <div class="name">设备１</div>
            <div class="color"></div>
            <div class="time">2024-01-04 12:00</div>
          </div>
        </div>
        <div class="video-wrap">
          <div class="video"></div>
          <div class="device-msg">
            <div class="name">设备１</div>
            <div class="color"></div>
            <div class="time">2024-01-04 12:00</div>
          </div>
        </div>
        <div class="video-wrap">
          <div class="video"></div>
          <div class="device-msg">
            <div class="name">设备１</div>
            <div class="color"></div>
            <div class="time">2024-01-04 12:00</div>
          </div>
        </div>
        <div class="video-wrap">
          <div class="video"></div>
          <div class="device-msg">
            <div class="name">设备１</div>
            <div class="color"></div>
            <div class="time">2024-01-04 12:00</div>
          </div>
        </div>
      </div>
    </main>
    <SearchDia v-model:visible="dialogVisible" @serachDigSure="serachDigSure" />
  </div>
</template>
<script setup lang="ts">
import SearchDia from "./component/DiaSearch";
import TitleName from "../../components/TitleName";
import { ref, reactive } from "vue";
let search = ref("");
let pageSize = ref("10");
let total = ref(111);
let currentPage = ref(1);
let dialogVisible = ref(false);

let selMonth = ref("day");
let value1 = ref("");
let formData = reactive({});
const defaultProps = {
  children: "children",
  label: "label",
};
const serachDigSure = () => {
  console.log("弹框确认");
};
const data = [
  {
    label: "Level one 1",
    children: [
      {
        label: "Level two 1-1",
        children: [
          {
            label: "Level three 1-1-1",
          },
        ],
      },
    ],
  },
  {
    label: "Level one 2",
    children: [
      {
        label: "Level two 2-1",
        children: [
          {
            label: "Level three 2-1-1",
          },
        ],
      },
      {
        label: "Level two 2-2",
        children: [
          {
            label: "Level three 2-2-1",
          },
          {
            label: "Level three 2-2-1",
          },
          {
            label: "Level three 2-2-1",
          },
          {
            label: "Level three 2-2-1",
          },
          {
            label: "Level three 2-2-1",
          },
          {
            label: "Level three 2-2-1",
          },
          {
            label: "Level three 2-2-1",
          },
          {
            label: "Level three 2-2-1",
          },
          {
            label: "Level three 2-2-1",
          },
          {
            label: "Level three 2-2-1",
          },
        ],
      },
    ],
  },
  {
    label: "Level one 3",
    children: [
      {
        label: "Level two 3-1",
        children: [
          {
            label: "Level three 3-1-1",
          },
        ],
      },
      {
        label: "Level two 3-2",
        children: [
          {
            label: "Level three 3-2-1",
          },
        ],
      },
    ],
  },
];
const handleNodeClick = (data) => {
  console.log(data);
};

const andleSelectionChange = () => {};
const openDia = () => {
  dialogVisible.value = true;
};
</script>
<style lang="scss" scoped>
.video-monitor {
  padding: 14px 17px 10px 13px;
  display: flex;
  .aside {
    height: calc(100vh - 10px - 130px);
    width: 272px;
    margin-right: 10px;
    background-color: #fff;
    padding: 31px 0 24px 17px;
    overflow: auto;
    .search-wrap {
      display: flex;
      align-items: center;
      background: #ffffff;
      border: 1px solid #176ff9;
      border-radius: 5px;
      height: 42px;
      width: 239px;
      padding-left: 28px;
      margin-bottom: 24px;
      cursor: pointer;

      span {
        font-weight: 400;
        color: #176ff9;
        font-size: 19px;
        padding-left: 11px;
      }
      .img {
        width: 19px;
        height: 19px;
      }
    }
  }
  .main {
    height: calc(100vh - 10px - 130px);
    width: calc(100vw - 295px - 161px);
    /* background-color: #fff; */
    .header {
      background: #ffffff;
      height: 125px;
      width: 100%;
      padding-top: 22px;

      .el-form {
        padding-top: 20px;
        padding-left: 23px;
        .el-button {
          font-size: 22px;
          font-weight: 400;
          color: #ffffff;
        }
        .search {
          width: 100px;
          height: 42px;
          border-radius: 5px;
          background: #0250f9;
          margin-left: 31px;
        }

        :deep(.el-button--large span) {
          margin: 4px !important;
        }
      }
    }
    .content {
      background: #ffffff;
      margin-top: 10px;
      width: 100%;
      height: calc(100vh - 173px - 101px);
      padding: 12px 0 0 19px;
      display: flex;
      flex-wrap: wrap;
      & .video-wrap:nth-of-type(even) {
        margin-left: 13px;
      }

      & .video-wrap:nth-child(1) {
        margin-top: 0;
      }
      & .video-wrap:nth-child(2) {
        margin-top: 0;
      }
      .video-wrap {
        .video {
          width: 572px;
          height: 260px;
          background: #999999;
        }
        .device-msg {
          width: 572px;
          height: 43px;
          background: #f4f4f4;
          display: flex;
          align-items: center;
          padding-left: 28px;
          padding-right: 41px;

          .name {
            font-size: 20px;
            font-weight: 500;
            color: #666666;
          }
          .color {
            width: 13px;
            height: 13px;
            background: #00ff00;
            border-radius: 50%;
            margin-left: 23px;
          }
          .time {
            font-size: 20px;
            font-weight: 500;
            color: #666666;
            flex-grow: 1;
            text-align: right;
          }
        }
      }
    }
  }
}
</style>
